/*
 * 
 *方法的整理与重构
 *
 *
 */

//定义app参数名称，并加载其它模块
var authApp=angular.module('authapp', ["ngCookies",'ngFileUpload','ui.bootstrap']);

//此为定位页面所用
authApp.value('page','evaluation_view');

/*controller部分*/

//主要操作controller
authApp.controller("opinionEditController",function($scope,$http,$getQueryString,$timeout,$sce){
	$scope.groupId=$getQueryString("groupId");
	
	//**********主体方法
	
	$scope.isEdit=false;
	var queryMainApi=apis.queyAuthExpertiseByGroupId;	
	var requestJson={"groupId":$scope.groupId};	
	$scope.queryMain=function(){
		$http({
			method:'post',
			url:queryMainApi,
			data:requestJson,
		}).success(function(response){
			if(response.code=="000000"){
				$scope.queryMainApiCallBack(response);
			}else{
				alert(response.errorMsg);
			}
		}).error(function(){
			alert("网络出现故障，请确认网络是否连接");
		})
	}
	$scope.queryMain();
	
	/*下面为自已编辑部分*/
	
	
	//调用主接口成功之后的处理方法
	$scope.queryMainApiCallBack=function(response){
		if(response.code=="000000"){
			$scope.list=response.data;
		}else{
			alert(response.errorMsg);
		}
	}
	
	//返回到前页面
	$scope.goback=function(){
		if(window.confirm("是否确认返回？")){
			javascript:history.back(-1);
		}
	}

})
